import { useState } from 'react'
import { useParams, useNavigate } from 'react-router-dom'
import { NavBar, Tabs } from 'react-vant'
import List from './components/list'
import styles from './index.module.css'
export default () => {
        const params = useParams()
        const navigate = useNavigate()
        const [active, setActive] = useState(parseInt(params.class))
        return (<div className={styles.fans}>
                <NavBar
                        title="粉丝/关注"
                        leftArrow
                        onClickLeft={() => navigate('/my')}
                />
                <Tabs active={active}>
                        <Tabs.TabPane title="关注"><List class={0} id={params.id} /></Tabs.TabPane>
                        <Tabs.TabPane title="粉丝"><List class={1} id={params.id} /></Tabs.TabPane>
                </Tabs>
        </div>)
}